#pragma once
#include <Client/Prerequisites.h>
#include <Client/ITriggerMgr.h>

BEGIN_NAMESPACE( Ci )

class SriptTriggerMgr : public ITriggerMgr
{
public:
	SriptTriggerMgr(void);
	~SriptTriggerMgr(void);

	void			update(float time) ;
	virtual void	pushEvent(std::string );
	void			reload();

	virtual void regesterITrigger(ITrigger* pITrigger) ;
	virtual void regesterEvent(ITriggerEvent* pITriggerEvent) ;
	virtual void regesterCondition(ITriggerCondition * pITriggerCondition) ;
	virtual void regesterAction(ITriggerAction* pITriggerAction) ;

	virtual void removeITrigger(const std::string & name) ;
	virtual void removeEvent(const std::string & name)  ;
	virtual void removeCondition(const std::string & name) ;
	virtual void removeAction(const std::string & name) ;



	virtual void regesterEventToITrigger(const std::string & Triggername,const std::string & name) ;
	virtual void regesterConditionToITrigger(const std::string & Triggername,const std::string & name) ;
	virtual void regesterActionToITrigger(const std::string & Triggername,const std::string & name) ;

	virtual void removeEventToITrigger(const std::string & Triggername,const std::string & name) ;
	virtual void removeConditionToITrigger(const std::string & Triggername,const std::string & name) ;
	virtual void removeActionToITrigger(const std::string & Triggername,const std::string & name) ;



	virtual ITriggerEvent*			getEvent(const std::string & name) ;
	virtual ITriggerCondition *		getCondition( const std::string & name);
	virtual ITriggerAction*			getAction(const std::string & name) ;

	 
protected:




	void _reset();
	std::deque<std::string >		mdequeTriggerEvent;
	std::list<ITrigger *>			mListTrigger;


	std::map<std::string , ITrigger*> mMapITrigger;
	std::map<std::string , ITriggerEvent*> mMapITriggerEvent;
	std::map<std::string , ITriggerCondition*> mMapITriggerCondition;
	std::map<std::string , ITriggerAction*> mMapITriggerAction;


};

END_NAMESPACE( Ci )